<table class="layui-table">
    <colgroup>
        <col>
        <col>
        <col>
        <col width="250">
    </colgroup>
    <thead>
    <tr>
        <th>风格名称</th>
        <th>排序</th>
        <th>是否显示</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach ($list as $data): ?>
        <tr>
            <td>
                <?php
                switch ($data['level']) {
                    case 0:
                        echo '├─&nbsp;';
                        break;
                    case 1:
                        echo '│&nbsp;&nbsp;&nbsp;├─&nbsp;';
                        break;
                    case 2:
                        echo '│&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;├─&nbsp;';
                        break;
                    case 3:
                        echo '│&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;├─&nbsp;';
                        break;
                }
                ?>

                <?= $data['class_name'] ?></td>
            <td><?= $data['sort'] ?></td>
            <td>
                <?php if ($data['is_show'] == 1): ?>
                    显示
                <?php else: ?>
                    隐藏
                <?php endif; ?>
            </td>
            <td>
                <a href="/member/list?role=<?= $data['personnel_class_id'] ?>"
                   class="layui-btn layui-btn-small">查看人员</a>
                <a href="/personnel-class/edit?personnel_class_id=<?= $data['personnel_class_id'] ?>"
                   class="layui-btn layui-btn-small">编辑</a>
                <button data-url="/personnel-class/remove?personnel_class_id=<?= $data['personnel_class_id'] ?>"
                   class="o-del-btn layui-btn layui-btn-small layui-btn-danger">删除</button>
            </td>
        </tr>
    <?php endforeach; ?>
    </tbody>
</table>
<script>
    layui.use(['form', 'laydate'], function () {
        var form = layui.form(),
            laydate = layui.laydate;
    });
</script>